﻿using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class B_SysConfig
    {
        DAL.D_SysConfig  d_config = new DAL.D_SysConfig();

        public List<Sys_config> ListConfig()
        {
            return d_config.listCconfig();
        }

        public bool AddConfig(List<Sys_config> list)
        {
            try
            {
                int res = d_config.addList(list);
                return res == list.Count ? true : false;
            }
            catch
            {
                throw new Tools.Add_Exception("添加失败！");
            }
        }

        public bool Del(List<Sys_config> list)
        {
            try
            {
                return d_config.del(list);
            }
            catch
            {
                throw new Tools.Del_Exception("删除失败！");
            }
        }

        public bool SaveList(List<Sys_config> sys_Configs)
        {
            try
            {
                return d_config.saveList(sys_Configs);
            }
            catch
            {
                throw new Tools.Modify_Exception("保存失败！");
            }
        }

    }
}
